#ifndef SLEEEXCELBOOK_H
#define SLEEEXCELBOOK_H
#include "sleeofficeglobal.h"
#include "sleeqaxptr.h"
#include "sleeexcelsheet.h"
#include <QHash>

class SLEEOFFICESHARED_EXPORT SleeExcelBook
{
    SleeQAxPtr m_exbook;
    SleeQAxPtr m_sheets;
    quint32 m_id;
    QHash <quint32, SleeExcelSheet * > mqh_sheets;
    quint32 m_last_id;
    inline quint32 gen_id() {return ++m_last_id;}
    SleeExcelSheet *get_sheet(QVariant &qv_sheet);
public:
    SleeExcelBook(const SleeQAxPtr &exbook, quint32 id);
    inline quint32 get_id() {return m_id;}
    void close(bool do_save = false);

    SleeExcelSheet *get_sheet(const QString &name);
    SleeExcelSheet *get_sheet(quint32 index);


    void save();
    void save_as(const QString &qstr_file_pathname);
};

#endif // SLEEEXCELBOOK_H
